---
layout: "default"
title: "fatalError"
description: "Swift documentation for 'fatalError': Unconditionally prints a given message and stops execution."
keywords: "fatalError,func,swift,documentation"
root: "/v3.1"
---

<div class="declaration" id="func-fatalerror_-autoclosure-string-file_-staticstring-line_-uint">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-fatalerror_-autoclosure-string-file_-staticstring-line_-uint">func fatalError(<wbr>_: @autoclosure (<wbr>) -&gt; String, file:<wbr> StaticString, line: UInt)</a>
        
<div class="comment collapse" id="comment-func-fatalerror_-autoclosure-string-file_-staticstring-line_-uint"><div class="p">
    <p>Unconditionally prints a given message and stops execution.</p>

<p><strong>Parameters:</strong>
  <strong>message:</strong> The string to print. The default is an empty string.
  <strong>file:</strong> The file name to print with <code>message</code>. The default is the file
    where <code>fatalError(_:file:line:)</code> is called.
  <strong>line:</strong> The line number to print along with <code>message</code>. The default is the
    line number where <code>fatalError(_:file:line:)</code> is called.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func fatalError(_ message: @autoclosure () -&gt; String = default, file: StaticString = #file, line: UInt = #line) -&gt; Never</code>
    
    
</div></div>
</div>
